<?php
#error_reporting(0);
$con = mysql_connect("localhost", "root", "");
mysql_select_db("se", $con);
$name = $_POST['newaccountname'];
$password = $_POST['password'];

echo $name;
echo "<br>";
echo $password;
if ($name==""){
	echo "<script type='text/javascript'>alert('账号不能为空，请输入账号');location='create.html';</script>";
}
else if($password==""){
	echo "<script type='text/javascript'>alert('密码不能为空，请输入账号');location='create.html';</script>";
}

else{
	$sql = "SELECT * FROM cus WHERE account = '$name'";
	$res = mysql_query($sql);
	$colum = mysql_fetch_array($res);
	if($colum['account']==$name && $colum['password']==$password){
		echo "<script type='text/javascript'>alert('登陆成功！');location='function.html';</script>";
	}
	else{
		
		echo "<script type='text/javascript'>alert('密码错误!');location='Homepage123.html';</script>";
	}

}

?>